<style>
    .table th {background: #f4f4f4;}
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <input type="hidden" id="c-id" value="{$row['id']}"/>
    <input type="hidden" id="c-order_no" value="{$row['order_no']}"/>
    <input type="hidden" id="c-check_in_time" value="{$row['check_in_time']}"/>
    <input type="hidden" id="c-check_out_time" value="{$row['check_out_time']}"/>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Order_no')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">{$row.order_no|htmlentities}</label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Source')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">
                <span class="label label-info">{$row.source|htmlentities}</span>
            </label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Order_status')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">
                <span class="label label-success">{$row['order_status_name']}</span>
            </label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('管理员备注')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">
                <span class="control-label">{$row['order_invalid_memo']}</span>
            </label>
        </div>
    </div>
   <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('收款')}:</label>
        <div class="col-xs-12 col-sm-8">
            <table class="table table-bordered table-nowrap" width="100%">
                <thead>
                    <tr>
                        <th>类型</th>
                        <th>金额</th>
                        <th>状态</th>
                        <th>附件</th>
                        <th>时间</th>
                        <th>收款人</th>
                    </tr>
                </thead>
                <tbody>
                    {if count($opList)}
                    {volist name="opList" id="item"}
                    <tr>
                        <td>{$item['pay_type']}</td>
                        <td>&yen;{$item['money']}</td>
                        <td>
                            {if $item['remarks']}
                            <a href="javascript:;" data-toggle="tooltip" data-placement="top" title="备注:{$item['remarks']}">
                            {if $item['state'] == 0}正常{else}已作废{/if}
                            </a>
                            {else}
                            {if $item['state'] == 0}正常{else}已作废{/if}
                            {/if}
                        </td>
                        <td>
                            {if $item['addons_list']}
                            {volist name="$item['addons_list']" id="ao"}
                            <a href="{$ao}" target="_blank"><img src="{$ao}" width="30"></a>
                            {/volist}
                            {/if}
                        </td>
                        <td>{$item['updatetime_txt']}</td>
                        <td>{$item['last_editor_nickname']}</td>
                    </tr>
                    {/volist}
                    {else}
                    <tr>
                        <td colspan="5">没有找到付款记录...</td>
                    </tr>
                    {/if}
                </tbody>
            </table>
        </div>
    </div>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('患者')}:</label>
        <div class="col-xs-12 col-sm-8">
            <table class="table table-bordered table-nowrap" width="100%">
                <tbody>
                    <tr>
                        <th>姓名</th>
                        <td>{$row.realname|htmlentities}</td>
                        <th>性别</th>
                        <td>{$row.sex_name|htmlentities}</td>
<!--                        <th>电话</th>-->
<!--                        <td>{$row.tel|htmlentities}</td>-->
                        <th>民族</th>
                        <td>{$row.nation|htmlentities}</td>
                    </tr>
                    <tr>
                        <th>证件</th>
                        <td>{$row.person_no|htmlentities} <span class="label label-primary">{$row.certificates_type}</span></td>
                        <th>出生日期</th>
                        <td>{$row.birthday|htmlentities}</td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <th>备注</th>
                        <td colspan="5">{$row.remarks|htmlentities}</td>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('同住客人')}:</label>
        <div class="col-xs-12 col-sm-8">
            <table class="table table-bordered table-nowrap" width="100%">
                <thead>
                    <tr>
                        <th>姓名</th>
                        <th>证件号码</th>
                        <th>联系电话</th>
                    </tr>
                </thead>
                <tbody>
                    {volist name="oplList" id="item"}
                    <tr>
                        <td>{$item['realname']} <span class="label {$item['sex_class']}">{$item['sex_name']}</span></td>
                        <td>{$item['person_no']} <span class="label label-primary">{$item['certificates_type']}</span></td>
                        <td>{$item['tel']}</td>
                    </tr>
                    {/volist}
                </tbody>
            </table>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('住院信息')}:</label>
        <div class="col-xs-12 col-sm-8">
            <table class="table table-bordered table-nowrap" width="100%">
                <tbody>
                    <tr>
                        <th>住院时间</th>
                        <td>{$row.check_in_date}</td>
                        <th>出院时间</th>
                        <td>{$row.check_out_date}</td>
                    </tr>
                    <tr>
                        <th>住院天数</th>
                        <td>{$row.days|htmlentities} 天</td>
                        <th>床号</th>
                        <td>
                            {$row.room_no}
                            <span class="label label-primary">{$row.room_type_name}</span>
                        </td>
                    </tr>
                </tbody>
                <!--<tfoot>
                    <tr>
                        <th>订单总金额</th>
                        <td colspan="3">&yen;{$row.total_price|htmlentities}</td>
                    </tr>
                </tfoot>-->
            </table>
        </div>
    </div>

    {if $row.addons}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('附件')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group" style="width: 98%;">
              <input id="c-addons" class="form-control" size="50" name="row[addons]" type="text" value="{$row.addons}" readonly>
              <div class="input-group-addon no-border no-padding hidden"> <span>
                <button type="button" id="plupload-addons" class="btn btn-danger plupload" data-input-id="c-addons" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-addons"><i class="fa fa-upload"></i> {:__('Upload')}</button>
                </span> </div>
            </div>
            <ul class="row list-inline plupload-preview" id="p-addons">
            </ul>
        </div>
    </div>
    {/if}

    <div class="form-group layer-footer">
        <div class="col-xs-12 col-sm-12 text-center" id="js_operate-box">
            {if $row.order_status == 0 || $row.order_status == -1}
                <button type="button" class="btn btn-primary btn-embossed" data-event="edit-room" style="margin-right: 0.5rem;">
                    {:__('更换床号')}
                </button>
                <button type="button" class="btn btn-primary" data-event="edit-linkman" style="margin-right: 0.5rem;">
                    <i class="fa fa-user"></i>
                    改患者信息
                </button>
                <button type="button" class="btn btn-primary" data-event="edit-date" style="margin-right: 0.5rem;">
                    <i class="fa fa-bed"></i>
                    改住院信息
                </button>
            {/if}

            {if $cancel == 1}
                <button type="button" class="btn btn-danger btn-embossed" id="cancel_reservation" style="margin-right: 0.5rem;">{:__('取消预约')}</button>
            {/if}
        </div>
    </div>


    <!-- <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div> -->
</form>

<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" data-backdrop="static">
    <div class="modal-dialog" role="document">
        <form id="modal-form" class="form-horizontal" role="modalform" data-toggle="validator" method="POST" action="">
            <input type="hidden" id="m-event">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="editModalLabel">更换床位</h4>
                </div>
                <div class="modal-body ">
                    <div id="m-edit-linkman" class="col-sm-12">
                        <div class="form-group" style="">
                            <div class="col-sm-3">
                                <div class="form-group">
                                    <label>{:__('所患疾病')}:</label>
                                    <select id="m-disease_id" data-rule="required" class="form-control">
                                        {volist name="category" id="item"}
                                        <option value="{$item['id']}" {in name="$item['id']" value="$row.disease_id" }selected{/in}>
                                        {$item['name']}
                                        </option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <div class="form-group">
                                    <label>患者姓名:</label>
                                    <div class="input-group">
                                        <div class="input-group-btn">
                                            <select class="form-control operate" id="m-sex" style="width:60px;">
                                                <option value="1" {in name="1" value="$row['sex']" }selected{/in}>男生</option>
                                                <option value="0" {in name="0" value="$row['sex']" }selected{/in}>女生</option>
                                            </select>
                                        </div>
                                        <input class="form-control" type="text" id="m-realname" value="{$row['realname']}" style="width:93%;">
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-5">
                                <div class="form-group">
                                    <label>证件号码:</label>
                                    <div class="input-group">
                                        <div class="input-group-btn">
                                            <select class="form-control operate" id="m-certificates_type" style="width:80px;">
                                                {volist name="certificatestypeList" id="item"}
                                                <option value="{$item['id']}" {in name="$item['id']" value="$row['certificates_type']" }selected{/in}> {$item['name']}</option>{/volist}
                                            </select>
                                        </div>
                                        <input type="text" id="m-person_no" class="form-control" value="{$row['person_no']}" style="width:91%;">
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-3">
                                <div class="form-group">
                                    <label>出生日期:</label>
                                    <div class="input-group" style="width:95%;">
                                        <input type="text" id="m-birthday" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" value="{$row['birthday_text']}">
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-12">
                                <div class="form-group">
                                    <label class="control-label">备注:</label>
                                    <textarea class="form-control" id="m-order_remarks" rows="3" style="width:98%;">{$row['remarks']}</textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="m-edit-date" class="col-sm-12">
                        <div class="form-group" style="">
                            <div class="col-sm-4">
                                <div class="form-group">
                                    <label>住院时间:</label>
                                    <input type="text" id="m-check_in_time" class="form-control datetimepicker"
                                           data-date-format="YYYY-MM-DD" data-date-min-date="{$row['check_in_time_text']}"
                                           value="{$row['check_in_time_text']}">
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <div class="form-group">
                                    <label>出院时间:</label>
                                    <input type="text" id="m-check_out_time" class="form-control datetimepicker"
                                           value="{$row['check_out_time_text']}" data-date-min-date="{:date('Y-m-d')}" data-date-format="YYYY-MM-DD">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="m-edit-room" class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('床位')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <select id="m-room-info" data-rule="required" class="form-control">
                                    {volist name="roomList" id="item"}
                                        {if $item['id'] != $row['room_info_id']}
                                            <option value="{$item['id']},{$item['room_type']}" {in name="$item['room_info']" value="$row.room_info"}selected{/in}>
                                                {$item['floor']}房间 - {$item['room_no']}号床位
                                            </option>
                                        {/if}
                                    {/volist}
                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label">理由:</label>
                            <textarea class="form-control" id="c-cancelRemarks" rows="3" style="width:98%;"></textarea>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary">确认提交</button>
                </div>
            </div>
        </form>
    </div>
</div>